import com.cuc.services.ClassService;
import com.cuc.services.Userservice;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test03 {
    //注解方式调用
    public static void main(String[] args) {
        //读取配置文件
        ClassPathXmlApplicationContext ac = new ClassPathXmlApplicationContext("spring-context.xml");

        //获取对象
        ClassService clazz01 = ac.getBean(ClassService.class);
        ClassService clazz02 = ac.getBean(ClassService.class);
        clazz01.getData();
        //验证多例
        System.out.println(clazz01 == clazz02);
    }
}
